/*
* @file stt.h
* @brief Header file for the STT (Speech-to-Text) class
* @author feiniao
* @version 1.0
* @date 2025-5-11
* @note It is not accurate after recognizing a few words.
*/

#ifndef STT_H
#define STT_H

#include "recoder.h"
#include "cJSON.h"
#include "esp_heap_caps.h"
#include "esp_psram.h"
#include "mbedtls/base64.h"
#include "esp_http_client.h"
#include "app/global_msg.h"

#define    TAG     "MY_STT"

#define API_URL_STT                             "https://vop.baidu.com/server_api"
#define CUID                                    "9zh2Ldb9IXsMdhOsjOdyid2KL6EcNxND"
#define STT_API_KEY                             "AGMFUDkOsmzha5H1b8ZAgds1"
#define STT_SECRET_KEY                          "Ju1DSK2RQl0wjua3fz4CVyvujcLH3We6"
#define MAX_RESPONSE_LEN                        2048
#define MIN(a, b) ((a) < (b) ? (a) : (b))

class STT {
private:
    Recorder recorder;
    void fetch_token_stt();
public:
    STT();
    ~STT();
    void process_int32t();
    void process_int16t();
};

#endif